package com.denlaku.longan.controller.impl;

import com.denlaku.longan.anno.RequestLimit;
import com.denlaku.longan.controller.RsaController;
import com.denlaku.longan.http.Resp;
import com.denlaku.longan.http.Return;
import com.denlaku.longan.util.RsaUtils;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author tianx
 */
@RestController
public class RsaControllerImpl implements RsaController {
    @Override
    @RequestLimit(permitsPerSecond = 30)
    public Return<String> getPublicKey() {
        return Resp.success(RsaUtils.getPublicKey());
    }
}
